package com.example.filter;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.*;
import java.io.IOException;

public class SecondFilter implements Filter {

    private static final Logger logger = LoggerFactory.getLogger(SecondFilter.class);

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        logger.info("SecondFilter init");
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        logger.info("SecondFilter enter doFilter");
        filterChain.doFilter(servletRequest, servletResponse);
        logger.info("SecondFilter exit doFilter");
    }

    @Override
    public void destroy() {
        logger.info("SecondFilter destroy");
    }

}
